<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>1</title>
    <script src="https://unpkg.com/vue@next"></script>
</head>
<style>
    .red{
        color: red;
    }
    .blue{
        color:blue;
    }
    .yellow{
        color: yellow;
    }
</style>
<body>
    <div id='root'>
        <div :class="classArray2">computed:</div>
        <demo class='red' />
    </div>
    <script>
        let app = Vue.createApp({
            data() {
                return {
                   classString:'red',
                   classObject:{
                       red:true,
                       'blue':true
                   },
                   classArray:['red','blue'],
                   classArray2:['red','blue',{
                        yellow:true
                   }],
                }
            }
        })

        app.component('demo',{
            template:`
                <div :class="$attrs.class">one</div>
                <div >two</div>
            `
        })



        let vm = app.mount('#root')
    </script>
</body>
</html>